﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Net;
using System.Net.Http;
using System.Threading;
using System.Threading.Tasks;
using System.Web;
using System.Web.Http;

namespace CDEPMS_API.Entities
{
    public class ApiHttpRequest
    {
        public bool status { get; set; }
        public dynamic data { get; set; }
        public string message { get; set; }

        public static ApiHttpRequest Success(dynamic data, string message = null)
        {
            ApiHttpRequest apiHttpRequest = new ApiHttpRequest();
            apiHttpRequest.status = true;
            apiHttpRequest.data = data;
            apiHttpRequest.message = message ?? "操作成功";
            return apiHttpRequest;
        }

        public static ApiHttpRequest Fail(string message = null)
        {

            ApiHttpRequest apiHttpRequest = new ApiHttpRequest();
            apiHttpRequest.status = false;
            apiHttpRequest.message = message ?? "操作失败";
            return apiHttpRequest;
        }

    }
}